package com.epfresh.bean;

import java.util.ArrayList;
import java.util.List;

public class GoodsParameters {
    //storeId,storeCategoryId
    private List<String> varietyIds;
    //现售(1)/预售(2)
    private List<String> types;
    private int pageNumber;
    private String storeId;
    private String storeCategoryId;
    private String sortProperty;
    private String origin;
    private int pageSize;
    private List<String> marketIds;
    private List<String> paymentModes;
    private String type;
    private List<String> deliveryModes;
    private String sortDirection;
    private Boolean isRecommended;
    //是否为选中
    private Boolean selected;

    //选中的品类id
    private List<String> nameIds;

    private String nameId;
    private String categoryId;
    private String deliveryTime;

    //topCategoryId 一级分类
    //categoryId 二级分类
    //categoryType 1,平台；2，自建
    private String topCategoryId;
    private String categoryType;


    private String tagId;

    private transient String name = "全部分类";
    private transient String parentId;
    private transient String grandParentId;
    private transient String filterCode;
    private transient String filterName;
    private transient String sortName = "排序";

    private String title;

    public List<String> getNameIds() {
        return nameIds;
    }

    public void setNameIds(List<String> nameIds) {
        this.nameIds = nameIds;
    }

    public String getTopCategoryId() {
        return topCategoryId;
    }

    public void setTopCategoryId(String topCategoryId) {
        this.topCategoryId = topCategoryId;
    }

    public String getCategoryType() {
        return categoryType;
    }

    public void setCategoryType(String categoryType) {
        this.categoryType = categoryType;
    }

    public String getTagId() {
        return tagId;
    }

    public void setTagId(String tagId) {
        this.tagId = tagId;
    }

    public String getFilterName() {
        return filterName;
    }

    public void setFilterName(String filterName) {
        this.filterName = filterName;
    }

    public String getSortName() {
        return sortName;
    }

    public void setSortName(String sortName) {
        this.sortName = sortName;
    }

    public String getFilterCode() {
        return filterCode;
    }

    public void setFilterCode(String filterCode) {
        this.filterCode = filterCode;
    }

    public String getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(String deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getStoreCategoryId() {
        return storeCategoryId;
    }

    public void setStoreCategoryId(String storeCategoryId) {
        this.storeCategoryId = storeCategoryId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getGrandParentId() {
        return grandParentId;
    }

    public void setGrandParentId(String grandParentId) {
        this.grandParentId = grandParentId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public String getSortProperty() {
        return sortProperty;
    }

    public void setSortProperty(String sortProperty) {
        this.sortProperty = sortProperty;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSortDirection() {
        return sortDirection;
    }

    public void setSortDirection(String sortDirection) {
        this.sortDirection = sortDirection;
    }

    public Boolean isRecommended() {
        return isRecommended;
    }

    public void setRecommended(Boolean recommended) {
        isRecommended = recommended;
    }

    public String getNameId() {
        return nameId;
    }

    public void setNameId(String nameId) {
        this.nameId = nameId;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public List<String> getVarietyIds() {
        return varietyIds;
    }

    public void setVarietyIds(List<String> varietyIds) {
        this.varietyIds = varietyIds;
    }

    public List<String> getTypes() {
        return types;
    }

    public void setTypes(List<String> types) {
        this.types = types;
    }

    public List<String> getMarketIds() {
        return marketIds;
    }

    public void setMarketIds(List<String> marketIds) {
        this.marketIds = marketIds;
    }

    public List<String> getPaymentModes() {
        return paymentModes;
    }

    public void setPaymentModes(List<String> paymentModes) {
        this.paymentModes = paymentModes;
    }

    public List<String> getDeliveryModes() {
        return deliveryModes;
    }


    public Boolean getSelected() {
        return selected;
    }

    public void setSelected(Boolean selected) {
        this.selected = selected;
    }

    public void setTypes(String type1, String type2) {

        if (types == null) {
            types = new ArrayList<>();
        }
        types.clear();
        if (type1 != null && !"".equals(type1))
            types.add(type1);
        if (type2 != null && !"".equals(type2))
            types.add(type2);

    }

    public String getTypeSingle(){
        if (types != null && types.size()>0){
            return types.get(0);
        }else {
            return null;
        }
    }

    public boolean hasType(){
        if(types != null && types.size() > 0){
            return true;
        }
        return false;
    }

    public void setDeliveryModes(List<String> deliveryModes) {
        this.deliveryModes = deliveryModes;
    }

    public boolean isFilter() {
        if (types != null && types.size() > 0) {
            return true;
        }
        return false;
    }

    @Override
    public String toString() {
        return "GoodsParameters{" +
                "varietyIds=" + varietyIds +
                ", types=" + types +
                ", pageNumber=" + pageNumber +
                ", sortProperty='" + sortProperty + '\'' +
                ", origin='" + origin + '\'' +
                ", pageSize=" + pageSize +
                ", marketIds=" + marketIds +
                ", paymentModes=" + paymentModes +
                ", type='" + type + '\'' +
                ", deliveryModes=" + deliveryModes +
                ", sortDirection='" + sortDirection + '\'' +
                ", isRecommended=" + isRecommended +
                ", nameId='" + nameId + '\'' +
                ", categoryId='" + categoryId + '\'' +
                '}';
    }
}
